// 修改数据

async function updateOne (collection, data) {
    const filter = {
        _id: data._id
    }
    const updateStr = { $set: data };
    const result = await collection.updateOne(filter, updateStr)
    return result;
}
async function updateMany (collection, params) {
    const filter = params.filter
    const updateStr = { $set: params.data };
    const result = await collection.updateMany(filter, updateStr)
    return result;
}
module.exports = {
	updateOne,
	updateMany
}